#include"standard_material.h"
shared_ptr<BSDF> StandardMaterial::createBSDF(Spectrum &color, P3 &norm, TransportMode mode)
{
	shared_ptr<BSDF> bsdf(new BSDF(norm));
	if (isSpec)
	{
		bsdf->addBxDF(new SpecularReflection());
		return bsdf;
	}
	Spectrum lbt_color = color * kd;
	if(!lbt_color.IsBlack())
		bsdf->addBxDF(new LambertianReflection(lbt_color));
	Spectrum phong_color = color*kh;
	if(!phong_color.IsBlack())
		bsdf->addBxDF(new BlinnPhongReflection(phong_color,blinnphong_n, divided_by_NdotL));
	return bsdf;
}